//
//  huiyijiaoliu.m
//  PASystem
//
//  Created by michael on 16/8/16.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "huiyijiaoliu.h"

@implementation huiyijiaoliu
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
    
    [self initview];
          }
    return self;
}

- (void)initview{

_tableview = [[UITableView alloc]initWithFrame:self.frame style:UITableViewStylePlain];
_tableview.dataSource = self;
_tableview.delegate = self;
self.tableview.bounces = NO;
[self addSubview:_tableview];

}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row==0) {
 
     UITableViewCell* cell = [[UITableViewCell alloc]init];
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, cell.contentView.height)];
    label.text = @"会议交流主题:";
     label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 UILabel *label2= [[UILabel alloc]initWithFrame:CGRectMake(label.right, label.top, KScreenWidth-120, label.height)];
    label2.text = _dic[@"NAME"];
    label2.textAlignment = NSTextAlignmentRight;

     label2.font = [UIFont systemFontOfSize:12];
    [cell.contentView addSubview:label2];
    return cell;
 
 }
if (indexPath.row==1) {
 
     UITableViewCell* cell = [[UITableViewCell alloc]init];
          cell.selectionStyle = UITableViewCellSelectionStyleNone;

      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, cell.contentView.height)];
    label.text = @"交流时间:";
     label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 UILabel *label2= [[UILabel alloc]initWithFrame:CGRectMake(label.right, label.top, KScreenWidth-120, label.height)];
 
  //时间
  NSString *string = _dic[@"COMMUNICATETIME"];
  NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
 fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
     NSDate *date = [fmt dateFromString:string];
     NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
     NSString *selfYear = [fm stringFromDate:date];

 label2.textAlignment = NSTextAlignmentRight;

    label2.text = selfYear;
     label2.font = [UIFont systemFontOfSize:12];
    [cell.contentView addSubview:label2];
    return cell;
 
 }
if (indexPath.row==2) {
 
     UITableViewCell* cell = [[UITableViewCell alloc]init];
          cell.selectionStyle = UITableViewCellSelectionStyleNone;

      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, cell.contentView.height)];
    label.text = @"我会参与人员:";
     label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 UILabel *label2= [[UILabel alloc]initWithFrame:CGRectMake(label.right, label.top, KScreenWidth-120, label.height)];
    label2.text = _dic[@"COMMUNICATETPERSON"];
    label2.textAlignment = NSTextAlignmentRight;

     label2.font = [UIFont systemFontOfSize:12];
    [cell.contentView addSubview:label2];
    return cell;
 
 }
else {
 
     UITableViewCell* cell = [[UITableViewCell alloc]init];
          cell.selectionStyle = UITableViewCellSelectionStyleNone;

      UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, cell.contentView.height)];
    label.text = @"交流地址:";
     label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 UILabel *label2= [[UILabel alloc]initWithFrame:CGRectMake(label.right, label.top, KScreenWidth-120, label.height)];
    label2.text = _dic[@"COMMUNICATEADD"];
    label2.textAlignment = NSTextAlignmentRight;

     label2.font = [UIFont systemFontOfSize:12];
    [cell.contentView addSubview:label2];
    return cell;
 
 }


 
 }

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
CGFloat H = 30;
//if (indexPath.row == 6){
// CGFloat titleSize = [OAToolBox sizebyText:_dic[@"TALKRESULT"] font:12 minsWidth:80];
//if (titleSize<44) {
//    return 44;
//}else{
//return titleSize;
//
//}
//}
//else{

return H;
//}

}



- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 4;
}
@end
